getItems Method |
This method searches for the specified item in the tree and returns all the items as an array.
Syntax
atreeItems = treeID.getItems(sText [, bInSensitive])
Parameters
Parameter |
Description |
---|---|
sText |
Required. String that specifies the description of the item to be search in the tree. |
bInSensitive |
Optional. Boolean that specifies whether the search is case-sensitive or not.
|
Return Value
Returns an array that contains all the tree items that are found. This method returns NULL if the particular item is not found.
Example
The following example shows how the above method is used.
//Function called to search the item "Favourites" in the tree "sampleTree" var items = sampleTree.getItems("Favourites"); //If items are not found, alert error, else display the data contained in each item if (items) { for(i = 0; i < items.length; i++); { application.notify("item " + i + ":\n\n" + cordys.getXML(items[i].data)); } } else { application.notify("Error ! Item not found !"); }